using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Nextel.Utils;

public partial class Mantenimiento_Eliminar : PageController
{
    #region Eventos
    protected override void initialize( )
    {
        String paId = Request.QueryString["Id"].Substring(1);
        String psHabilitar = Request.QueryString["R"];
        String lsPagRedirect = string.Empty;
        try
        {

            if (URLManager.WEB_ACTIVIDAD == Request.QueryString["hidModulo"])
            {
                lsPagRedirect = Request.ApplicationPath + URLManager.URL_ACTIVIDAD;
                DALBase.delete("USPW_ACTIVIDAD_D", paId, psHabilitar);
            }

            else if (URLManager.WEB_TIPOACTIVIDAD == Request.QueryString["hidModulo"])
            {
                lsPagRedirect = Request.ApplicationPath + URLManager.URL_TIPOACTIVIDAD;
                DALBase.delete("USPW_TIPO_ACTIVIDAD_D", paId, psHabilitar);
            }

            else if (URLManager.WEB_USUARIO == Request.QueryString["hidModulo"])
            {
                lsPagRedirect = Request.ApplicationPath + URLManager.URL_USUARIO;
                DALBase.delete("USPW_USUARIO_D", paId, psHabilitar);
            }

            else if (URLManager.WEB_PERFIL == Request.QueryString["hidModulo"])
            {
                lsPagRedirect = Request.ApplicationPath + URLManager.URL_PERFIL;
                DALBase.delete("USPW_PERFIL_D", paId, psHabilitar);
            }
            else if (URLManager.WEB_ESTADOS == Request.QueryString["hidModulo"])
            {
                lsPagRedirect = Request.ApplicationPath + URLManager.URL_ESTADOS;
                DALBase.delete("USPW_ESTADO_D", paId, psHabilitar);
            }
            else if (URLManager.WEB_MOTIVOS == Request.QueryString["hidModulo"])
            {
                lsPagRedirect = Request.ApplicationPath + URLManager.URL_MOTIVOS;
                DALBase.delete("USPW_MAESTRO_D", paId, psHabilitar);
            }
            else if (URLManager.WEB_CLIENTE == Request.QueryString["hidModulo"])
            {
                lsPagRedirect = Request.ApplicationPath + URLManager.URL_CLIENTE;
                DALBase.delete("USPW_CLIENTE_D", paId, psHabilitar);
            }
        }catch(Exception e) 
        {
            Response.Redirect(lsPagRedirect +"?hidError="+HttpUtility.HtmlEncode(e.Message));
            BaseLN.registrarLog("ERROR:" + e); 
        }

        Response.Redirect(lsPagRedirect);
    }
    #endregion

    


}
